#pragma once
#include "TCharSupport.h"
#include "EpilTableObject.h"


class EpilInterpreter;


enum EpilScopeType
{
	EST_Normal,
	EST_Function
};


class EpilScope
{
public:
	EpilScope( EpilInterpreter * interpreter, EpilScope * parent );
	virtual ~EpilScope();

	virtual EpilScopeType				GetScopeType() const							{ return EST_Normal; }

	EpilInterpreter *					GetInterpreter() const							{ return m_interpreter; }
	EpilScope *							GetParent() const								{ return m_parent; }
	EpilTableObject &					GetLocals()										{ return m_locals; }
	const EpilTableObject &				GetLocals() const								{ return m_locals; }

	EpilObject *						GetLocal( const tstring & name ) const;
	void								SetLocal( const tstring & name, EpilObject * obj );

private:
	EpilInterpreter *					m_interpreter;
	EpilScope *							m_parent;
	EpilTableObject						m_locals;
};
